import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizApparchDemand = (params) => {
  params.head.transCode = 'queryBizApparchDemand';
  return request({
    url: '/biz/apparch/bizApparchDemand/queryBizApparchDemand',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizApparchDemandListPage = (params) => {
  params.head.transCode = 'queryBizApparchDemandListPage';
  return request({
    url: '/biz/apparch/bizApparchDemand/queryBizApparchDemandListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizApparchDemand = (params) => {
  params.head.transCode = 'saveBizApparchDemand';
  return request({
    url: '/biz/apparch/bizApparchDemand/saveBizApparchDemand',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizApparchDemandList = (params) => {
  params.head.transCode = 'saveBizApparchDemandList';
  return request({
    url: '/biz/apparch/bizApparchDemand/saveBizApparchDemandList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizApparchDemand = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchDemand';
  return request({
    url: '/biz/apparch/bizApparchDemand/saveOrUpdateBizApparchDemand',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizApparchDemandList = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchDemandList';
  return request({
    url: '/biz/apparch/bizApparchDemand/saveOrUpdateBizApparchDemandList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizApparchDemand = (params) => {
  params.head.transCode = 'updateBizApparchDemand';
  return request({
    url: '/biz/apparch/bizApparchDemand/updateBizApparchDemand',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizApparchDemand = (params) => {
  params.head.transCode = 'deleteBizApparchDemand';
  return request({
    url: '/biz/apparch/bizApparchDemand/deleteBizApparchDemand',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizApparchDemandList = (params) => {
  params.head.transCode = 'deleteBizApparchDemandList';
  return request({
    url: '/biz/apparch/bizApparchDemand/deleteBizApparchDemandList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizApparchDemandExcel = (params) => {
  downloadExcel({
    url: '/biz/apparch/bizApparchDemand/excelDownload/exportBizApparchDemandExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
